Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

define-property

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

define-property

Define a non-enumerable property on an object.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25M
decreased by-59.68%
Maintainers
1
Weekly downloads
 
Created

What is define-property?

The define-property npm package is used to define a new property directly on an object, or modify an existing property on an object, and return the object. It is a convenience wrapper around Object.defineProperty that allows you to easily set configurable, enumerable, and writable property attributes.

What are define-property's main functionalities?

Define a new property with default attributes

This feature allows you to define a new property on an object with default attributes. The property will be configurable, enumerable, and writable.

{"object": {"foo": "bar"}, "propertyName": "newProp", "value": 123}

Define a new property with custom attributes

This feature allows you to define a new property on an object with custom attributes, such as making the property non-writable.

{"object": {"foo": "bar"}, "propertyName": "newProp", "descriptor": {"value": 123, "configurable": true, "enumerable": true, "writable": false}}

Other packages similar to define-property

Keywords

FAQs

Package last updated on 20 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc